﻿using B.S.Packaged.Domain;
using B.S.Packaged.ErrorCode;
using B.S.Packaged.WebAPI.Read.Application.Command.CompletedfinishedCommand;
using B.S.Packaged.WebAPI.Read.Application.Command.CompletedStorageCommand;
using B.S.Packaged.WebAPI.Read.Application.Command.PackagingQualityCommand;
using MediatR;
using Microsoft.AspNetCore.Mvc;

namespace B.S.Packaged.WebAPI.Read.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class CompletedStorageController : ControllerBase
    {
        private readonly IMediator mediator;
        public CompletedStorageController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        /// <summary>
        /// 完工入库显示
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIResult<APIPaging<CompletedStorage>>> GetCompletedStorage([FromQuery] GetCompletedStorageCommand request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 完工入库反填
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIResult<List<CompletedStorage>>> FTCompletedStorage([FromQuery] FTCompletedStorageCommand request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 包装成品完工表反填
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIResult<List<Completedfinished>>> FTCompletedfinished([FromQuery] FTCompletedfinishedCommand request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 包装成品完工表显示
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIResult<APIPaging<Completedfinished>>> GetCompletedfinished([FromQuery] GetCompletedfinishedCommand request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 包装成品质检表显示
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIResult<List<PackagingQuality>>> FTPackagingQuality([FromQuery] FTPackagingQualityCommand request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 包装成品质检表显示
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIResult<APIPaging<PackagingQuality>>> GetPackagingQualityHandle([FromQuery] GetPackagingQualityCommand request)
        {
            return await mediator.Send(request);
        }
    }
}
